package com.bsoft.exchange.controller.appointmentandregistration;



import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.bsoft.exchange.domain.ListAppointmentWait;
import com.bsoft.exchange.pojo.ListAppointmentWaitPojo;
import com.bsoft.exchange.response.ResponseEntity;
import com.bsoft.exchange.service.ListAppointmentWaitService;
import com.bsoft.exchange.util.BaseResponse;
import com.bsoft.exchange.util.Constant;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = "appointment")
public class ListAppointmentWaitController {
	@Autowired
	private ListAppointmentWaitService listAppointmentWaitService;
	@ApiOperation(value = "4.1.7预约列表获取")
	@RequestMapping(value = "/listAppointmentWait",method = RequestMethod.POST,produces = "application/json")

	public ResponseEntity<List<ListAppointmentWait>> selectList(@RequestBody ListAppointmentWaitPojo listAppointmentWaitPojo) {
//		List<ListAppointmentWait> listAppointmentWait = listAppointmentWaitService.selectList(listAppointmentWaitPojo);
//		
//			ResponseEntity<List<ListAppointmentWait>> entity=new ResponseEntity<>();
//			
//			entity.setData(listAppointmentWait);
//			
//			return entity;
		BaseResponse<List<ListAppointmentWait>> listAppointmentWait = listAppointmentWaitService.selectList(listAppointmentWaitPojo);
		
		ResponseEntity<List<ListAppointmentWait>> entity=new ResponseEntity<>();
		
		if (listAppointmentWait.getCode()==Constant.errorTag){
        	entity.setCode(0);
        	entity.setMessage(listAppointmentWait.getMessage());
            return entity;
        }
	
	
	 entity.setData(listAppointmentWait.getData());


	return entity;
	}

}
